package cn.iocoder.yudao.module.crossborder.logistics.api.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 物流跟踪信息 DTO
 *
 * @author LHL
 */
@Schema(description = "RPC 服务 - 物流跟踪信息 DTO")
@Data
public class TrackingDTO {

    @Schema(description = "跟踪编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    private Long id;

    @Schema(description = "物流编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
    private Long logisticsId;

    @Schema(description = "跟踪号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SF1234567890")
    private String trackingNumber;

    @Schema(description = "物流服务商编号", example = "3072")
    private Long providerId;

    @Schema(description = "物流服务商名称", example = "顺丰速运")
    private String providerName;

    @Schema(description = "当前状态", example = "1")
    private Integer currentStatus;

    @Schema(description = "当前状态描述", example = "运输中")
    private String currentStatusDesc;

    @Schema(description = "当前位置", example = "上海转运中心")
    private String currentLocation;

    @Schema(description = "最后更新时间")
    private LocalDateTime lastUpdateTime;

    @Schema(description = "跟踪事件列表")
    private List<TrackingEventDTO> events;

    @Schema(description = "备注", example = "正常运输中")
    private String remark;

    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    /**
     * 跟踪事件 DTO
     */
    @Schema(description = "跟踪事件信息")
    @Data
    public static class TrackingEventDTO {

        @Schema(description = "事件编号", example = "1024")
        private Long id;

        @Schema(description = "事件类型", example = "1")
        private Integer eventType;

        @Schema(description = "事件描述", example = "快件已从【深圳】发出")
        private String eventDesc;

        @Schema(description = "事件位置", example = "深圳市")
        private String location;

        @Schema(description = "事件时间")
        private LocalDateTime eventTime;

        @Schema(description = "操作员", example = "张三")
        private String operator;

        @Schema(description = "备注", example = "正常")
        private String remark;

    }

}
